<template>
  <view class="container">
    <image :src="$util.img('/image/pay_success.png')" mode=""></image>
    <view class="font-40 text-bold m-b-20">支付成功</view>
    <view class="m-b-60">订单支付成功，请前往查看</view>
    <view class="flex-center">
      <view class="confirm" @click="goHome()">确定</view>
    </view>
    
  </view>
</template>

<script>
  export default {
    data() {
      return {
         type: '', //food,mall
      }
    },
    onLoad(e) {
      if(e.type) {
        this.type = e.type;
      }
    },
    methods: {
      goHome() {
        if(this.type === 'mall') {
          this.$util.redirectTo('/pages/mallOrder/mallOrder',{},'reLaunch');
        }else if(this.type === 'food') {
          this.$util.redirectTo('/pages/foodOrder/foodOrder',{},'reLaunch');
        }else  {
          this.$util.redirectTo('/pages/index/index');
        }
      },
    }
  }
</script>

<style>
	page {
		background: #fff;
	}
</style>
<style lang="scss" scoped>
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 100rpx;
}
image {
  width: 165.22rpx;
  height: 165.22rpx;
  margin-bottom: 40rpx;
}
.confirm {
  width: 244rpx;
  height: 84rpx;
  line-height: 84rpx;
  text-align: center;
  border-radius: 60rpx;
  background-color: $color-title2;
  color: #fff;
  box-sizing: border-box;
}
.confirm_border {
  background-color: $color-bg!important;
  color: $color-title2!important;
  border: 1px solid $color-title2;
}
</style>
